.\" SPDX-License-Identifier: CC-BY-SA-4.0 or-later
.\" SPDX-FileCopyrightText: 2025 grommunio GmbH
.TH midb 8gx "" "Gromox" "Gromox admin reference"
.SH Name
midb \(em Message Index database daemon
.SH Synopsis
\fBmidb\fP [\fB\-c\fP \fIconfig\fP]
.SH Description
midb is used by imap(8gx) and pop3(8gx) to generate and keep track of folder
and message summaries. In particular, it enumerates messages to give them their
IMAP UID and have at all times a suitable UIDNEXT value for folders ready. midb
also caches the Message-Id, modification date, message flags, subject and
sender to facilitate IMAP listings.
.SH Options
.TP
\fB\-c\fP \fIconfig\fP
Read configuration directives from the given file. If this option is not
specified, /etc/gromox/midb.cfg will be read if it exists.
.TP
\fB\-\-version\fP
Output version information and exit.
.TP
\fB\-?\fP
Display option summary.
.PP
All time-based command-line options and configuration file directives are
subject to the syntax described in gromox(7), section "Duration
specifications".
.SH Configuration directives (gromox.cfg)
The following directives are recognized when reading from
/etc/gromox/gromox.cfg, or when the \fB\-c\fP option is used to specify a
custom file:
.TP
\fBdaemons_fd_limit\fP
In gromox-midb, this is treated as an alias for midb_fd_limit.
.TP
\fBmidb_fd_limit\fP
Request that the file descriptor table be at least this large. The magic value
0 indicates that the system default hard limit (rlim_max, cf. setrlimit(2))
should be used.
.br
Default: \fI0\fP
.SH Configuration directives (midb.cfg)
The following directives are recognized when reading from /etc/gromox/midb.cfg,
or when the \fB\-c\fP option is used to specify a custom file:
.TP
\fBconfig_file_path\fP
Colon-separated list of directories which will be scanned when locating further
configuration files, especially those used by subcomponent instances. (For
example, mysql_adaptor(4gx) would be directed to look at
/etc/gromox/midb/mysql_adaptor.cfg before /etc/gromox/mysql_adaptor.cfg.)
.br
Default: \fI/etc/gromox/midb:/etc/gromox\fP
.TP
\fBdata_file_path\fP
Colon-separated list of directories which will be scanned when locating data
files.
.br
Default: \fI/usr/share/gromox/midb\fP
.TP
\fBdefault_charset\fP
Default: \fIwindows-1252\fP
.TP
\fBmidb_cache_interval\fP
The time after the last use of a particular midb.sqlite3 that the sqlite gets
unloaded.
.br
Default: \fI30minutes\fP
.TP
\fBmidb_cmd_debug\fP
Log every incoming MIDB command and the return code of the operation in a
minimal fashion to stderr (not midb_log_file!). Level 1 emits commands with a
failure return code, level 2 emits all commands. Logs are written to stderr
only.
.br
Default: \fI0\fP
.TP
\fBmidb_hosts_allow\fP
A space-separated list of individual host addresses that are allowed to
converse with the midb service. The addresses must conform to gromox(7) \sc
"Host addresses". No networks and no CIDR notations are permitted. This option
deprecates the /etc/gromox/midb_acl.txt file used before Gromox 2.8.
.br
Default: \fI::1\fP
.TP
\fBmidb_listen_ip\fP
An IPv6 address (or v4-mapped address) for exposing the event service on.
.br
Default: \fI::1\fP
.TP
\fBmidb_listen_port\fP
The TCP port number for exposing the event service on.
.br
Default: \fI5555\fP
.TP
\fBmidb_log_file\fP
Target for log messages here. Special values: "\fI-\fP" (stderr/syslog
depending on parent PID) or "\fIsyslog\fP" are recognized.
.br
Default: \fI-\fP (auto)
.TP
\fBmidb_log_level\fP
Maximum verbosity of logging. 1=crit, 2=error, 3=warn, 4=notice, 5=info, 6=debug.
.br
Default: \fI4\fP (notice)
.TP
\fBmidb_reload_interval\fP
The time after a midb.sqlite3 was first loaded that it will be unloaded.
.br
Default: \fI60min\fP
.TP
\fBmidb_schema_upgrades\fP
This directive controls whether database schemas are automatically upgraded
when a message index database (midb.sqlite) is loaded. During this time, that
DB is unavailable and operations on it will be delayed. Connection aborts, if
any, would be due to timeouts in components other than midb. (The file can
temporarily grow to double its size, so ample disk space may be required.)
.br
Default: \fIyes\fP
.TP
\fBmidb_table_size\fP
Default: \fI5000\fP
.TP
\fBmidb_threads_num\fP
The minimum number of client processing threads to keep around.
.br
Default: \fI100\fP
.TP
\fBnotify_stub_threads_num\fP
Default: \fI10\fP
.TP
\fBrpc_proxy_connection_num\fP
.br
Default: \fI10\fP
.TP
\fBsqlite_debug\fP
If set to 1, every query given to SQLite prepare/execute is logged.
If set to 0, only failed queries are logged. (It cannot be made completely
silent, since our queries ought to never fail.)
.br
Default: \fI0\fP
.TP
\fBx500_org_name\fP
Default: (unspecified)
.SH Files
.IP \(bu 4
\fIconfig_file_path\fP/exmdb_list.txt: exmdb multiserver selection map.
.SH See also
\fBgromox\fP(7)
